#ifndef __MC_INCLUDE_H__
#define __MC_INCLUDE_H__

#include "stm32f429xx.h"
#include "stm32f4xx.h"
#include "../../Drivers/BSP/beep/Beep.h"
#include "../../Drivers/BSP/debug_uart/debug_uart.h"
#include "../../Drivers/BSP/RS485/rs485.h"
#include "../../Drivers/BSP/sterper/sterper.h"
#include "../../Drivers/BSP/malloc/malloc.h"
#include "../../Drivers/BSP/W25Qxx/spi.h"
#include "../../Drivers/BSP/W25Qxx/w25qxx.h"
#include "tftlcd_delay.h"
#include "lcd_gpio.h"
#include "cmsis_os2.h"
#include <rtx_os.h>
#include <rtx_evr.h>
#include "ff.h"
#include "GUIFont_Create.h"
#include "../../Drivers/BSP/motor/motor.h"
#include "../../Drivers/BSP/mystring/mystring.h"
#include "../../Drivers/BSP/limit/limit.h"
#include "../../Drivers/BSP/GCode/gcode.h"
#include "../../Drivers/BSP/GCode/gcode_ex.h"
#include "../../Drivers/BSP/eeprom/eeprom.h"
#include <stdio.h>
#include <string.h>
/************相关类型定义*****************/
/******为了兼容垃圾正点原子显示器驱动*****/
/***************begin*********************/
typedef int32_t  s32;
typedef int16_t s16;
typedef int8_t  s8;

typedef const int32_t sc32;
typedef const int16_t sc16;
typedef const int8_t sc8;

typedef __IO int32_t  vs32;
typedef __IO int16_t  vs16;
typedef __IO int8_t   vs8;

typedef __I int32_t vsc32;
typedef __I int16_t vsc16;
typedef __I int8_t vsc8;

typedef uint32_t  u32;
typedef uint16_t u16;
typedef uint8_t  u8;

typedef const uint32_t uc32;
typedef const uint16_t uc16;
typedef const uint8_t uc8;

typedef __IO uint32_t  vu32;
typedef __IO uint16_t vu16;
typedef __IO uint8_t  vu8;

typedef __I uint32_t vuc32;
typedef __I uint16_t vuc16;
typedef __I uint8_t vuc8;
/***************end*********************/

#include "tftlcd.h"
#include "sdram.h"
#include "touch.h"
#include "dma2d.h"
#include "../../Drivers/BSP/malloc/malloc.h"


/**为了防止计算的时候产生误差，一律使用整型，即距离值要扩大十倍**/
/* 运行初始化参数结构体 */
typedef struct
{
    __IO int32_t mm_pulse;          //0.1mm等于多少脉冲
    __IO int32_t X_Max_range;       //X轴最大行程
    __IO int32_t Y_Max_range;       //Y轴最大行程
    __IO int32_t Z_Max_range;       //Z轴最大行程

} MC_Config_TypeDef;

/**为了防止计算的时候产生误差，一律使用整型，即距离值要扩大十倍**/
/* 运行中参数结构体 */
typedef struct
{
    __IO int32_t X_current;               //X轴当前坐标
    __IO int32_t Y_current;               //Y轴当前坐标
    __IO int32_t Z_current;               //Z轴当前坐标

    __IO int32_t X_work_current;          //X轴当前工作坐标
    __IO int32_t Y_work_current;          //Y轴当前工作坐标
    __IO int32_t Z_work_current;          //Z轴当前工作坐标

	__IO int32_t X_count; //X轴计数
	__IO int32_t Y_count; //Y轴计数
	__IO int32_t Z_count; //Z轴计数
	
	__IO int32_t X_offset; //X轴坐标偏移
	__IO int32_t Y_offset; //Y轴坐标偏移
	__IO int32_t Z_offset; //Z轴坐标偏移

} MC_Execute_TypeDef;

extern uint8_t limit_en[3];
extern UART_HandleTypeDef debug_uart;
extern  uint8_t RS485_RxBuff[50];
extern uint8_t ucnt;
extern volatile uint8_t Rxflag;
extern uint16_t stepper_speed;
extern MC_Config_TypeDef MC_Config_param;
extern MC_Execute_TypeDef MC_Execute_param;
extern void GUI_GetOnoPiont(void);
extern void parameter_init(void);



/***********邮箱定义*************/
//电机控制邮箱
typedef struct
{
    uint32_t speed;
} motor_mail;


/********************************/
#endif

